<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('auth.login');
});

Route::get('/logout', function () {
	return view('auth.logout');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

//	Route::get('users/admin', function () {
//		return view('users');
//	});

Route::get('test', 'TestController@index');

Route::group(['middleware'=>['web']],function(){

    Route::get('user/list', 'UserController@index');
    Route::resource('user', 'UserController');
    Route::any('user/edit/{id}', 'UserController@edit');
    Route::post('user/{id}', 'UserController@update');
    Route::get('user/list/del', 'UserController@deleteUser');

    Route::get('roles/list', 'RolesController@index');
    Route::resource('roles', 'RolesController');
    Route::get('roles/edit/{id}', 'RolesController@edit');
    Route::post('roles/{id}', 'RolesController@update');
    Route::get('roles/list/del', 'RolesController@delete');

    Route::get('operationLog/list', 'OperationLogController@index');
    Route::get('operationLog/list/del', 'OperationLogController@delete');

    Route::get('userAccount/list', 'UserAccountController@index');
    Route::any('userAccount/{id}', 'UserAccountController@show');
    Route::any('userAccount/list/order/{id}', 'UserAccountController@showOrder');
	Route::get('userAccount/activeManage/list', 'UserAccountController@getActiveUserManage');
	Route::get('userAccount/activeManage/send/{id}', 'UserAccountController@sendCouponToUser');
	Route::get('userAccount/activeManage/sendSave', 'UserAccountController@sendCouponSave');
	Route::get('userAccount/statistics/register', 'UserAccountController@userAccountRegisterStatistics');


    Route::get('bankShop/list', 'BankShopController@index');
    Route::resource('bankShop', 'BankShopController');
    Route::get('bankShop/edit/{id}', 'BankShopController@edit');
    Route::post('bankShop/{id}', 'BankShopController@update');
    Route::get('bankShop/list/del', 'BankShopController@delete');
	Route::any('bankShop/info/equip/{id}', 'BankShopController@showEp');
	Route::any('bankShop/info/order/{id}', 'BankShopController@showOrder');
    Route::post('bankShop/list/state', 'BankShopController@changShopState');

	Route::get('equipment/list', 'EquipmentController@index');
	Route::resource('equipment', 'EquipmentController');
	Route::get('equipment/edit/{id}', 'EquipmentController@edit');
	Route::post('equipment/{id}', 'EquipmentController@update');
	Route::get('equipment/list/del', 'EquipmentController@delete');
	Route::post('equipment/list/state', 'EquipmentController@changShopState');
	Route::any('equipment/info/order/{id}', 'EquipmentController@showOrder');

	Route::get('order/list', 'OrderController@index');
	Route::any('order/{id}', 'OrderController@show');
	Route::any('order/order_statistic/chart', 'OrderController@orderDataStatistics');
	Route::any('order/order_money/chart', 'OrderController@orderMoneyStatistics');


	Route::get('suggest/list', 'UserAccountSuggestController@index');

	Route::get('coupon/list', 'CouponController@index');
	Route::resource('coupon', 'CouponController');
	Route::any('coupon/edit/{id}', 'CouponController@edit');
	Route::post('coupon/{id}', 'CouponController@update');
	Route::get('coupon/list/del', 'CouponController@delete');
	Route::get('coupon/statistics/userAccount', 'CouponController@getCouponUseStatistics');

	Route::get('activity/list', 'ActivityController@index');
	Route::resource('activity', 'ActivityController');
	Route::get('activity/edit/{id}', 'ActivityController@edit');
	Route::post('activity/{id}', 'ActivityController@update');
	Route::get('activity/list/del', 'ActivityController@delete');
	Route::any('activity/info/{id}', 'ActivityController@show');

	Route::get('serveProject/list', 'ServeProjectController@index');
	Route::resource('serveProject', 'ServeProjectController');
	Route::get('serveProject/edit/{id}', 'ServeProjectController@edit');
	Route::post('serveProject/{id}', 'ServeProjectController@update');
	Route::get('serveProject/list/del', 'ServeProjectController@delete');
	Route::any('serveProject/order/info/{id}', 'ServeProjectController@show');

	Route::get('stateConfig/list', 'StateConfigController@index');
	Route::resource('stateConfig', 'StateConfigController');
	Route::get('stateConfig/edit/{id}', 'StateConfigController@edit');
	Route::post('stateConfig/{id}', 'StateConfigController@update');
	Route::get('stateConfig/list/del', 'StateConfigController@delete');

	Route::get('exchangeCode/list', 'ExchangeCodeController@index');
	Route::resource('exchangeCode', 'ExchangeCodeController');
	Route::any('exchangeCode/edit/{id}', 'ExchangeCodeController@edit');
	Route::post('exchangeCode/{id}', 'ExchangeCodeController@update');
	Route::get('exchangeCode/list/del', 'ExchangeCodeController@delete');

});


	Route::any('testHello', 'CurrentDayController@index');
	Route::any('dayOrderTotal', 'CurrentDayController@getOrderToday');// 订单总数、今日、昨日、差额
	Route::any('dayOrderMoney', 'CurrentDayController@getOrderMoneyToday');// 金额总数、今日、昨日、差额
	Route::any('dayOrderInfo', 'CurrentDayController@getOrderInfoToday');//交易详情
	Route::any('dayRegisterTotal', 'CurrentDayController@getRegisterToday');//注册总数、今日、昨日、差额
	Route::any('dayBankShopTotal', 'CurrentDayController@getBankShopOrderToday');//网点分布、top5
	Route::any('dayCouponTotal', 'CurrentDayController@getBankShopCouponTotal');
	Route::any('dayChartData', 'CurrentDayController@getMoneyChartData'); // 折线图
	Route::any('bankShopMap', 'CurrentDayController@getBankShopNames'); // 网点地图

	Route::any('weatherInfo', 'CurrentDayController@getWeatherInfo'); // 天气信息


